package com.itheima.mydemo.test4;

import java.lang.reflect.Method;

public class Test4 {
    public static void main(String[] args) {
        method(new Swimming() {
            @Override
            public void goSwimming() {
                System.out.println("去游泳");
            }
        });
        method(()->{System.out.println("去游泳");});
    }

    public static void method(Swimming swimming){
        swimming.goSwimming();
    }
}
interface Swimming{
    void goSwimming();
}